package com.neu.util;

import android.content.SharedPreferences;

import com.neu.App;

public class SpHelper {
    private final static String FILE_NAME="config";

    public static String getString(String name){
        return getStSp().getString(name,"");
    }

    public static void setString(String name,String value){
        SharedPreferences sp=getStSp();
        SharedPreferences.Editor editor=getStSp().edit();
        editor.putString(name,value);
        editor.commit();



    }

    /**
     * 获得SharedPreferences 对象
     * @return
     * 本地的操作
     *冲突文件
     */
    private static SharedPreferences getStSp(){
        return App.context.getSharedPreferences(FILE_NAME,App.context.MODE_PRIVATE);
    }
}
